package com.example.administrator.caigou51.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.ArrayList;

/**
 * Created by Administrator on 2015/8/11.
 */
public class MainFragmentAdapter extends FragmentStatePagerAdapter {
    public static final int COUNT = 5;
    public ArrayList<Fragment> list;
    public MainFragmentAdapter(FragmentManager fm) {
        super(fm);
    }
    public MainFragmentAdapter(FragmentManager fm, ArrayList<Fragment> list){
        super(fm);
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }
}
